<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<title>Unibox</title>

<meta name="description" content="">

	<meta name="keywords" content="">

		<meta http-equiv="Content-Type"
			content="text/html; charset=ISO-8859-1">

			<link href="css/style.css" rel="stylesheet" type="text/css">

				<link rel="stylesheet" href="css/bootstrap.min.css">
					<script src="js/jquery.js"></script>
					<script src="js/bootstrap.min.js"></script>

					<script src="project/js/validazione.js"></script>
					<script src="project/js/globals.js"></script>

</head>

<script type="text/javascript">
	function SelezTT() {
		var i = 0;
		var modulo = document.modulo.elements;
		for (i = 0; i < modulo.length; i++) {
			if (modulo[i].type == "checkbox") {
				if (modulo[i].checked == false) {
					modulo[i].checked = !(modulo[i].checked);
				}
			
			
			}

		}
	}
</script>



<body>

<%@ page import="it.unisa.unibox.beans.Account"%>
	<%@ page import="it.unisa.unibox.beans.Ricercatore"%>
	
	<%
	    Ricercatore ric = (Ricercatore) session.getAttribute("ricercatore");
		Account ac = (Account) session.getAttribute("account");
		if (ac == null || ric == null) {
			response.sendRedirect("index.jsp");
		}
		
		 if(ric!=null && ric.getRuolo()==2){	%>
		 <script type="text/javascript">
		 caricaProdottiCompleti.call();
		 </script>
		<%	
			}
		 if(ric!=null && ric.getRuolo()==3){	%>
		 <script type="text/javascript">
		 caricaProdottiAccettati.call();
		 </script>
		<%	
			}
		
	%>
	
	<div class="main">
		<div class="page">
			<div class="header">
				<div class="header_logo"></div>
			</div>			
			<div class="topmenu">
				<ul>
					<li
						style="background: transparent none repeat scroll 0% 50%; -moz-background-clip: initial; -moz-background-origin: initial; -moz-background-inline-policy: initial; padding-left: 0px;">
						<a href="home.jsp">Home</a>
					</li>
					<li><a href="ricerca.jsp">Ricerca</a></li>
					<li><a href="inserimento.jsp">Inserimento</a></li>
					<% 
					 if(ric!=null && (ric.getRuolo()==2 || ric.getRuolo()==3)){
					%>
					<li><a href="validazione.jsp" style="color: #33CCCC">Validazione</a></li>
					<% 
					 }
					%>
					
					<li id="notify"></li>
					
					<a onClick="logout()" class="btn btn logout">Logout</a>

				</ul>
			</div>
			<!--HEADER-->

			<div class="content">

				<br> <!--DIV PRINCIPALE-->

					<form method="post" name="modulo">

						<div class="row-fluid offset1">
							<!--Body  cambiare l'offset x la posizione-->

							<h3>Lista Prodotti Completi</h3>
							
							<% if(ric!=null && ric.getRuolo()==2){	%>
		 
		

							<div class="span4 offset8">
								
										<button type="submit" onClick="accettaTutti()" class="btn btn-success">

											<i class="glyphicon glyphicon-trash"></i> <span>Accetta
												tutti</span>

										</button>
									
							</div>
							
							<%	
									} 
									
							if(ric!=null && ric.getRuolo()==3){	%>
		 
		

							<div class="span4 offset8">
								
										<button type="submit" onClick="validaTutti()" class="btn btn-success">

											<i class="glyphicon glyphicon-trash"></i> <span>Valida
												tutti</span>

										</button>
									
							</div>
							
							<%	
									} %>
									
									
							<div class="row-fluid">
						<div class="span8 ">


							<table class="table" border=2 >
								<!-- Tabella prodotti -->
								<thead id=intestazione>
									
								</thead>
								<tbody id="listaProdotti">
								<!-- IL CONTENUTO DINAMICO DELLA TABELLA SI AGGIUNGE QUI -->
								
								</tbody>
							
								
							</table>
						</div>

</div>
							
							

							

							<div class="accordion" id="accordion2">

								<!--Div Grande Avanzate-->
								<div id="collapseOne" class="accordion-body collapse">

									<div class="row-fluid"></div>

									<!--fine action-inner  !!!-->

								</div>

								<!--fine accordion-group !!!-->
							</div>
							<!--fine accordion  !!!-->
						</div>
			</div>

			</form>
		</div>

		<!--body interno-->

		<br>

			<div class="footer">

				<!--FOOTER-->

				<!--DO NOT Remove The Footer Links-->

				<img src="images/footnote.gif" class="copyright"
					alt="html templates"></a>

					<p>

						&copy; Copyright 2010. Designed by <a class="footer-link"
							target="_blank">Unibox Studio</a>

						<!--DO NOT Remove The Footer Links-->

					</p>
			</div> <!--Chiusura DIV FOOTER-->
	</div>

	<!--DIV PRINCIPALE-->
<a id=accettaButton href="#accetta_alert"  style="visibility:hidden" data-toggle="modal"></a>


<!--DIV PRODOTTO ACCETTATO CON SUCCESSO-->      
<div id="accetta_alert" class="modal hide fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">

  <div class="modal-header">
    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
    <h4 id="myModalLabel">Prodotti</h4>
  </div>
  <div class="modal-body">
    <p>I prodotti sono stati accettati!</p>
  </div>
  <div class="modal-footer">
    <button class="btn btn-danger" onClick="window.location.href='./validazione.jsp'" data-dismiss="modal">Conferma </button>
  </div>
</div><!--DIV ACCETTA-->	

	
</body>

</html>